<?php

namespace App\Models\Open;

use App\Models\Common\Media;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Rennokki\QueryCache\Traits\QueryCacheable;

class SysAccount extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'sys_accounts';

//    use QueryCacheable;
//
//    protected $cacheFor = 3600;
//    protected static $flushCacheOnUpdate = true;

    protected $fillable = [
        'token', 'aes_key', 'access_token',
    ];

    public function platform(): BelongsTo
    {
        return $this->belongsTo(Platform::class );
    }

    public function appType(): BelongsTo
    {
        return $this->belongsTo(AppType::class, 'app_type_id' );
    }

    public function qr(): BelongsTo
    {
        return $this->belongsTo(Media::class, 'qrcode' );
    }

}
